package com.seanLab.tool.es;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.seanLab.domain.TagInfo;

import java.util.ArrayList;

/**
 * Created by mac on 17/9/13.
 */
public class ImageTagRet {
    private String imgID;
    private int imgCate;
    private double imgScore;
    private String imgLocalURL;
    private ArrayList<TagInfo> imgTagsList;

    public String getImgID() {
        return imgID;
    }

    public void setImgID(String imgID) {
        this.imgID = imgID;
    }

    public String getImgLocalURL() {
        return imgLocalURL;
    }

    public void setImgLocalURL(String imgLocalURL) {
        this.imgLocalURL = imgLocalURL;
    }

    public ArrayList<TagInfo> getImgTagsList() {
        return imgTagsList;
    }

    public void setImgTagsList(ArrayList<TagInfo> imgTagsList) {
        this.imgTagsList = imgTagsList;
    }

    public ImageTagRet(String imgID, int imgCate, double imgScore, String imgLocalURL, ArrayList<TagInfo> imgTagsList) {
        this.imgID = imgID;
        this.imgCate=imgCate;
        this.imgScore=imgScore;
//        this.imgSource = imgSource;
        this.imgLocalURL = imgLocalURL;
        this.imgTagsList = imgTagsList;
    }

    public ImageTagRet() {
    }

    public String buildJson(){
        String s= null;
        try {
            ObjectMapper mapper=new ObjectMapper();
            s = mapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return s;
    }

    public void setImgCate(int imgCate) {
        this.imgCate = imgCate;
    }

    public int getImgCate() {
        return this.imgCate;
    }

    public double getImgScore() {
        return imgScore;
    }

    public void setImgScore(double imgScore) {
        this.imgScore = imgScore;
    }
}
